package dnl.confij.c9s;

import java.awt.Color;

import dnl.confij.ValueConverter;

public class ColorConversion implements ValueConverter {

	public String format(Object obj) {
		Color color = (Color) obj;
		return color.getRed() + "," + color.getGreen() + "," + color.getBlue();
	}

	public Object parse(String s) {
		return Colors.fromRgbString(s);
	}

	public Class<?> getConvertedType() {
		return Color.class;
	}

	public Class<?>[] getSupportedTypes() {
		return new Class[] { Color.class };
	}

}
